package com.eric.rabbitmq.object;

import com.eric.rabbitmq.bean.User;
import com.eric.rabbitmq.config.RabbitSimpleConfig;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author chenw-i
 * @version 1.0.0
 * @ClassName ObjSender.java
 * @Description TODO
 * @createTime 2020年07月29日 17:04:00
 */
@Component
public class ObjReceiver {

    /**
     * 如果接受的是不同类型的数据，尽量使用不同的队列
     * @param user
     */
    @RabbitHandler
    @RabbitListener(queues = RabbitSimpleConfig.QUEUE_OBJECT)
    public void process(Object user) {
        System.out.println("Receiver  : " + user);
    }
}
